package org.pp.vo;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.Map;

@Setter
@Getter
public class MiniappOrderItemVo {

    @Schema(description = "商品id")
    private Long goodsId;

    @Schema(description = "sku的id")
    private Long skuId;

    @Schema(description = "用户id")
    private Long userId;

    @Schema(description = "订单id")
    private Long orderId;

    @Schema(description = "商品名称")
    private String name;

    @Schema(description = "sku封面图")
    private String cover;

    @Schema(description = "售价")
    private BigDecimal price;

    @Schema(description = "选择的属性值拼接")
    @TableField(exist = false)
    private String attrInfoStr;

    @Schema(description = "库存")
    private Integer stock;

    @Schema(description = "选择的属性值")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Map<String,String> attrInfo;

    @Schema(description = "购买数量")
    private Integer amount;

    @Schema(description = "商品总价（售价乘以数量，感觉冗余)")
    private BigDecimal totallPrice;

    @Schema(description = "邮费")
    private BigDecimal totallPostage;

    @Schema(description = "邮费说明")
    private String totallPostageDesc;

    @Schema(description = "单件运费")
    private BigDecimal postage;

    @Schema(description = "发货地")
    private String postFrom;

    @Schema(description = "是否免运费")
    private Boolean postageIfFree;

    @Schema(description = "是否服从系统满免运费规则")
    private Boolean postageInRuleIfFree;

    @Schema(description = "相同sku邮费是否合并")
    private Boolean postageSkuIfMerge;

    @Schema(description = "满减规则的，瞬间阈值")
    private BigDecimal postageThreshold;
}
